  
%FOR YOU TO DO in Step 1:
%%%%%%%%CHECK THESE VARIABLES%%%%%%%%

% Isobaric models require these parameters:

      %Strings
%         worksheetName2Save: Name of Step 1 file to save
%         IsobaricOrPolybaric: Either 'Isobaric' or 'Polybaric'
%         forceSpPlag: Either 'force Sp-Plag Boundary' or 'do not force Sp-Plag Boundary' (set to 9kbars if forced)
%         
      %Vectors (can be a single number or multiple numbers)
%         Porosity_vary: Porosity vector to interate, e.g. "[0 0.01 1]" Any number from 0 to 1.  1=pure batch, 0= pure fractional
%         PIsobaric_vary: Pressure vector to interate in kbars, e.g. "[5 10 15]" 
%         BulkCompositions_vary: Bulk composition vector to iterate, e.g. "[8 18]" tagged by the numbers in the spreadsheet "AAA_PETROGEN_SourcesAndDs". You can add more 
%         dFdPwaterchange_vary: Vector of melt productivity factor vector below anhydrous solidus, e.g. "[10]"
%         initialwatercontent_vary: Vector of source water contents in ppm, e.g. [0 250]
%         MaxF= Vector of high degree of melting desired in melt fractions e.g., [0.05 0.10 0.30] which is 5%, 10%, and 30% melting  



%Polybaric models require these parameters:
      %Strings
%         worksheetName2Save: Name of Step 1 file to save
%         IsobaricOrPolybaric : Either 'Isobaric' or 'Polybaric'
%         GeodynamicModel='yes'; 
%         forceSpPlag = Either 'force Sp-Plag Boundary' or 'do not force Sp-Plag Boundary' or 'do not force Sp-Plag Boundary' (set to 9kbars if forced)
%         dFdP_Type = 'constant' or 'variable'. Variable function defined on L248 in 'XXX_Function_ExecuteSaveMultiple_PETROGEN2020.m'
% 
%       %Vectors (can be a single number or multiple numbers)
%         BulkCompositions_vary:  Bulk composition vector to iterate, e.g. "[8 18]" tagged by the numbers in the spreadsheet "AAA_PETROGEN_SourcesAndDs". You can add more 
%         TP_vary : Mantle potential temperature vector to iterate, right now can only do [1300 1350 1400 1450] using the geophysical model
%         afewfunrnuns_U_vary : Half spreading rate vector to iterate, max options include [0.5 1 2 3 4 6 8 10] cm/yr
%         Porosity_vary : Porosity vector to interate, e.g. "[0 0.01 1]" Any number from 0 to 1.  1=pure batch, 0= pure fractional
%         initialwatercontent_vary: Vector of source water contents in ppm, e.g. [0 250] 
%         dFdPwaterchange_vary: Factor by which melt productivity (dFdP) is chnaged by when melting below anhydrous solidus e.g. [1 10]; 
     
        %Single Numbers
%         dFdP = 0.01; % Single melt productivity value when constant in melt fraction per kbar i.e., 0.01 = 1% melt per kbar
%         AdiabatSlope = 1.1; %Adiabatic gradient in C/kbar



% EXAMPLES BELOW:

% TO AVOID ERRORS ONLY HAVE ONE SET OF MELTING CONDITIONS UNCOMMENTED AT A TIME 

%% ISOBARIC MELTING 
% EXAMPLE 1 WKR melting for comparison to Walter (1998)
worksheetName2Save='Step1_Brownetal2020_Isobaric_KLB';
IsobaricOrPolybaric = 'Isobaric';
forceSpPlag = 'force Sp-Plag Boundary';
Porosity_vary = [1];
PIsobaric_vary =  [10 15 30 40 45 50];
BulkCompositions_vary = [7];
dFdPwaterchange_vary=[10]; 
initialwatercontent_vary = [0]; 
MaxF=0.3; 

%% POLYBARIC MELTING


%%
%%%%% Uncomment the following code to make Step 1 Figures 5 and 6
% worksheetName2Save='Step1_Fig56';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% dFdP_Type = 'constant';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% BulkCompositions_vary = [18]; 
% TP_vary = [1300 1350 1400 1450]; 
% afewfunrnuns_U_vary = [0.5 1 2 3 4 6 8 10]; 
% Porosity_vary = [0.001 0.02]; 
% initialwatercontent_vary=[0 200 500 1000];
% dFdPwaterchange_vary=[10];
% dFdP = 0.01;  
% AdiabatSlope = 1.1;

%%
%%%%% Uncomment the following code to make Step 1 Figures 4 and 5 in Brown et al. (2020)
worksheetName2Save='Step1_Figs7and8';
IsobaricOrPolybaric = 'Polybaric';
GeodynamicModel='yes';
forceSpPlag = 'dont force Sp-Plag Boundary';
dFdP_Type = 'constant';
BulkCompositions_vary = [18];
TP_vary = [1450]; 
afewfunrnuns_U_vary = [1];
Porosity_vary = [0.001 0.02]; 
initialwatercontent_vary=[0 500];
dFdPwaterchange_vary=[10]; 
dFdP = 0.01;  
AdiabatSlope = 1.1;
%%
%%%%% Uncomment the following code to make Step 1 Figures 4 and 5 in Brown et al. (2020)
% worksheetName2Save='Step1_Fig9';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% dFdP_Type = 'constant';
% BulkCompositions_vary = [1:31];
% TP_vary = [1300 1350 1400 1450]; 
% afewfunrnuns_U_vary = [1];
% Porosity_vary = [0.001];
% initialwatercontent_vary=[500];
% dFdPwaterchange_vary=[10];
% dFdP = 0.01; 
% AdiabatSlope = 1.1;
%%
%%%%% Uncomment the following code to make Figures 10
% worksheetName2Save='Step1_Fig10';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% dFdP_Type = 'constant';
% BulkCompositions_vary = [1:31];
% TP_vary = [1300 1350 1400 1450];
% afewfunrnuns_U_vary = [1]; 
% Porosity_vary = [0.01]; 
% initialwatercontent_vary=[0];
% dFdPwaterchange_vary=[10]; 
% dFdP = 0.01;
% AdiabatSlope = 1.1;
%%
%%%%% Uncomment the following code to make Step 1 Figures 4 and 5 in Brown et al. (2020)
% worksheetName2Save='Step1_Fig11';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% dFdP_Type = 'constant';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% BulkCompositions_vary = [1:31];
% TP_vary = [1300 1350 1400 1450]; 
% afewfunrnuns_U_vary = [3]; 
% Porosity_vary = [0.02]; 
% initialwatercontent_vary=[0];
% dFdPwaterchange_vary=[10]; 
% dFdP = 0.01; 
% AdiabatSlope = 1.1;

%%

%%%%% Uncomment the following code to make Step 1 Figures 4 and 5 in Brown et al. (2020)
% worksheetName2Save='Step1_Fig121314';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% dFdP_Type = 'constant';
% BulkCompositions_vary = [8 18]; 
% TP_vary = [1300 1400]; 
% afewfunrnuns_U_vary = [6]; 
% Porosity_vary = [0.001 0.01]; 
% initialwatercontent_vary=[0 350];
% dFdPwaterchange_vary=[10]; 
% dFdP = 0.01; 
% AdiabatSlope = 1.1;

%%
%%%%% Uncomment the following code to make Step 1 Figures 4 and 5 in Brown et al. (2020)
% worksheetName2Save='Step1_FigsS2S3';
% IsobaricOrPolybaric = 'Polybaric';
% GeodynamicModel='yes';
% forceSpPlag = 'dont force Sp-Plag Boundary';
% dFdP_Type = 'constant';
% BulkCompositions_vary = [1:31]; 
% TP_vary = [1300 1350 1400 1450]; 
% afewfunrnuns_U_vary = [1]; 
% Porosity_vary = [0.001]; 
% initialwatercontent_vary=[0];
% dFdPwaterchange_vary=[10]; 
% dFdP = 0.01; 
% AdiabatSlope = 1.1;


%% UNIVERSAL 
% Trace element source composition
Petrogen_Co_Name = 'PUM'; %This defaults to Hart and Zindler PUM. Can be changed later.
%Petrogen_Co_Name = 'One'; % This defaults to no initial signature

